//引入全部的全局组件
import SvgIcon from './SvgIcon/Index.vue'
import Pag from './SvgIcon/Index.vue'
//引入emlemet-plus提供全部图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//console.log(ElementPlusIconsVue)

const allGloablComponet: any = { SvgIcon, Pag } //相当与{SvgIcon:SvgIcon, Pag:Pag},键值一致可以简写

//对外暴露插件对象
export default {
  //务必叫做install方法
  install(app: any) {
    Object.keys(allGloablComponet).forEach((key: string) => {
      //注册为全局组件
      app.component(key, allGloablComponet[key])
    })
    // console.log(Object.entries(ElementPlusIconsVue)[0])

    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  }
}
